package ruifeng.zcj.dig.ui.home;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import java.util.ArrayList;

import ruifeng.zcj.dig.base.DepositFragmentActivity;
import ruifeng.zcj.dig.base.FragmentInfo;
import ruifeng.zcj.dig.groble.FragmentArgs;
import ruifeng.zcj.dig.ui.home.recruit.RecruitFragment;
import ruifeng.zcj.dig.ui.home.repair.RepairFragment;

/**
 * Created by Administrator on 2016/9/3 0003.
 */
public class HomAllActivity extends DepositFragmentActivity {

    public static void launch(Activity activity,
                              Class<? extends Fragment> clazz,
                              FragmentArgs args) {
        Intent intent = new Intent(activity, HomAllActivity.class);
        intent.putExtra(KEY_CLASS_NAME, clazz.getName());
        if (args != null) {
            intent.putExtra(KEY_ARGS, args);
        }
        activity.startActivity(intent);
    }

    @Override
    protected void addPage(ArrayList<String> tabTitles, ArrayList<FragmentInfo> fragmentInfos) {
        tabTitles.add("测试下哈");
        fragmentInfos.add(new FragmentInfo(RecruitFragment.class, getBundle(1)));

        tabTitles.add("测试下哈");
        fragmentInfos.add(new FragmentInfo(RepairFragment.class, getBundle(1)));
    }

    public void setScreenPageLimit() {
        mViewPager.setOffscreenPageLimit(mBaseFragmentViewPageAdapter.getCount());
    }
}
